package com.yexiao.cofe.business.controller;

import com.alibaba.fastjson2.JSONObject;
import com.yexiao.cofe.business.service.ParamValueService;
import com.yexiao.cofe.resolver.IRequestParam;
import com.yexiao.cofe.resolver.IRequestToken;
import com.yexiao.core.response.ResponseData;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author lkl
 * @since 2025/4/1
 */
@RestController
@RequestMapping("/param/value")
public class ParamValueController {

    @Resource
    private ParamValueService paramValueService;

    @PostMapping("/add")
    public ResponseData addParamValue(@RequestBody JSONObject param, @IRequestToken String token) {
        paramValueService.addParamValue(param);
        return ResponseData.success();
    }

    @GetMapping("/del")
    public ResponseData deleteParamValue(@IRequestParam JSONObject param, @IRequestToken String token) {
        paramValueService.deleteParamValue(param);
        return ResponseData.success();
    }

    @PostMapping("/modify")
    public ResponseData modify(@RequestBody JSONObject param, @IRequestToken String token) {
        paramValueService.modifyParamValue(param);
        return ResponseData.success();
    }


}
